package concurrent;

/**
 * @Author: admin
 * @Description:
 * @Date: 2019/1/15 8:33
 */

public class Aync1 {
    public synchronized void  methodA () throws InterruptedException {
        System.out.println(Thread.currentThread().getId()+"\t"+"methodA  begin");
        Thread.sleep(1000);
        System.out.println(Thread.currentThread().getId()+"\t"+"methodA  end");
    }

    public synchronized void  methodB () throws InterruptedException {
        System.out.println(Thread.currentThread().getId()+"\t"+"methodB  begin");
        Thread.sleep(1000);
        System.out.println(Thread.currentThread().getId()+"\t"+"methodB  end");
    }

//    class  ThreadA

    public static void main(String[] args) {

    }
}
